// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';
import Home from '@/pages/HomePage.vue';
import User from '@/pages/UserInfo.vue';
import Restaurant from '@/pages/RestaurantInfo.vue';

const routes = [
    {
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: '/user',
        name: 'User',
        component: User
    },
    {
        path: '/restaurant',
        name: 'Restaurant',
        component: Restaurant
    },
    {
        path: '/',
        redirect: '/home' // 默认跳转到首页
    }
];

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
});

export default router;